package com.killer.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.killer.user.entity.Address;
import com.killer.user.mapper.AddressMapper;
import com.killer.user.service.IAddressService;
import com.killer.db.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 地址表 服务实现类
 * </p>
 *
 * @author killer
 * @since 2021-11-06
 */
@Service
public class AddressServiceImpl extends BaseServiceImpl<AddressMapper, Address> implements IAddressService {

    @Override
    public List<Address> listAddressByUserId(Long userId) {
        LambdaQueryWrapper<Address> queryWrapper= Wrappers.lambdaQuery();
        queryWrapper.eq(Address::getUserId, userId);
        return baseMapper.selectList(queryWrapper);
    }
}
